package com.dong.homework;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Student {
    private int id;
    private String name;
    private String sex;
    private String birth;
    private Score score=new Score();

    public Student() {
        this.id = id;
        this.name = name;
        this.sex = sex;
    }

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getBirth() {
        Date date = new Date();
        String str="yyyy-MM-dd";
        SimpleDateFormat sdf = new SimpleDateFormat(str);
        birth=sdf.format(date);
        return birth;
    }

    public String setBirth(Date birth) {
        Date date = new Date();
        String str="yyyyMMdd";
        SimpleDateFormat sdf = new SimpleDateFormat(str);
        return sdf.format(date);
    }
    public void getScore(){
        Student student = new Student();
        int chinese = student.score.getChinese();
        int math = student.score.getMath();
        int enlish = student.score.getEnlish();
        int sum=chinese+math+enlish;
        System.out.println("分数为:"+student.toString());
        System.out.println("总分为:"+sum);
        System.out.println("平均分为:"+sum/3);

    }

    @Override
    public String toString() {
        return "Student{" +
                ", score=" + score +
                '}';
    }
}
